/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2010
 */

package com.osgix.authorize.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.osgix.common.pojo.BaseEntity;

public class RoleInfo extends BaseEntity implements java.io.Serializable {
	private static final long serialVersionUID = 5454155825314635342L;

	// alias
	public static final String TABLE_ALIAS = "RoleInfo";
	public static final String ALIAS_ROLE_ID = "roleId";
	public static final String ALIAS_ROLE_NAME = "roleName";
	public static final String ALIAS_SUPER_ROLE_ID = "superRoleId";
	public static final String ALIAS_NOTE = "note";

	// date formats

	// 可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	// columns START

	private Long roleId;
	@NotBlank
	@Length(max = 128)
	private java.lang.String roleName;

	private Long superRoleId;
	@Length(max = 1024)
	private java.lang.String note;

	// columns END

	public RoleInfo() {
	}

	public RoleInfo(Long roleId) {
		this.roleId = roleId;
	}

	public void setRoleId(Long value) {
		this.roleId = value;
	}

	public Long getRoleId() {
		return this.roleId;
	}

	public void setRoleName(java.lang.String value) {
		this.roleName = value;
	}

	public java.lang.String getRoleName() {
		return this.roleName;
	}

	public void setSuperRoleId(Long value) {
		this.superRoleId = value;
	}

	public Long getSuperRoleId() {
		return this.superRoleId;
	}

	public void setNote(java.lang.String value) {
		this.note = value;
	}

	public java.lang.String getNote() {
		return this.note;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("RoleId", getRoleId())
				.append("RoleName", getRoleName()).append("SuperRoleId", getSuperRoleId()).append("Note", getNote())
				.toString();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(getRoleId()).toHashCode();
	}

	public boolean equals(Object obj) {
		if (obj instanceof RoleInfo == false)
			return false;
		if (this == obj)
			return true;
		RoleInfo other = (RoleInfo) obj;
		return new EqualsBuilder().append(getRoleId(), other.getRoleId()).isEquals();
	}
}
